<?php


namespace app\admin\exception;


use think\exception\Handle;
use think\Response;
use Throwable;

class Http extends Handle
{

    private $httpStatusCode = 501;

    public function render($request, Throwable $e): Response
    {
        if (method_exists($e, 'getStatusCode')){
            $this->httpStatusCode = $e->getStatusCode();
        }
        return show(1, $e->getMessage(), [], $this->httpStatusCode);
    }

}